home *** CD-ROM | disk | FTP | other *** search
/ Libris Britannia 4 / science library(b).zip / science library(b) / INFO / DOSTIPS4.ZIP / DOSMISC.TXT < prev    next >
Text File  |  1986-06-28  |  35KB  |  681 lines

  1.                            Spaced Out
  2.      (PC Magazine Vol 5 No 1 January 14, 1986 User-to-User)
  3.  
  4.      DOS uses a space character to delimit its command and operands.
  5. If a space is part of a filename, DOS will become confused.  If you
  6. enter:  COPY A:MY PROG.BAS B:MY PROG.BAS, DOS will assume you want the
  7. program called MY on drive A: copied to the default drive using the
  8. filename PROG.BAS and will ignore the B:MY PROG.BAS completely.
  9.      Many otherwise excellent programs allow an unsuspecting user to
  10. create filenames containing spaces.  This is because assembly language
  11. uses an apostrophe, a comma or a zero to delimit filenames.  Similarly,
  12. BASIC uses quotes to delimit its filenames.
  13.      Most programs that allow you to create filenames containing spaces
  14. will also allow you to read those files. However, if you try to perform
  15. certain DOS-level operations such as COPY or REName on these files, you
  16. will either not succeed or will make a confused mess of your files.  In
  17. addition, while the DOS DIR command can at least read filenames with
  18. spaces, BASIC's FILES command will display the filename only up to the
  19. space character.
  20.      If you do create filenames containing spaces, there are two
  21. methods you can use to remove the space or rename the file completely.
  22. Let's assume you have a file called "PROG 1.BAS" and you want to call
  23. it "PROG-1.BAS".
  24.      Method 1 (DOS):  Use the wildcard character "?" and the DOS REName
  25. command:  REN PROG?1.BAS PROG-1.BAS.
  26.      Method 2 (BASIC):  Use the BASIC NAME command, which uses quotes
  27. as a delimiter and isn't confused by space characters:
  28. NAME "PROG 1.BAS" AS "PROG-1.BAS".
  29.     Editor's Note:  An interesting BASIC but that's actually a feature.
  30. BASIC really shouldn't allow the creation of DOS files with spaces
  31. inside them, but since it does, it can also correct space/filename
  32. errors.
  33.  
  34. -----------------------------------------------------------------
  35.                          More and Better
  36.               (PC World January 1986 Star-Dot-Star)
  37.  
  38.      If you have ever used the TYPE command to examine the contents
  39. of a file, you know that it is difficult to prevent the text from
  40. scrolling off the screen before you have had a chance to read it.
  41. (Note:  Ctrl-NumLock will pause any file TYPEd.)  You have probably
  42. also made the mistake of trying to TYPE a file created with WordStar,
  43. only to find it displayed as gibberish.
  44.      The solution to the first problem is the program MORE.COM,
  45. included in DOS 2.00 and later versions.  The program displays text
  46. 24 lines at a time, pausing between screenfuls until you press a key.
  47. Instead of using the TYPE command, you just type MORE < filename.
  48. Unfortunately, MORE.COM displays everything exactly as stored in the
  49. file, so you still have to hack your way through the gibberish produced
  50. by word processing codes.
  51.      TYPEMORE.COM is almost the same as MORE.COM, but it displays
  52. legible WordStar files.  You can use TYPEMORE.COM exactly the same
  53. way you used MORE.COM.
  54.  
  55.  
  56.                          Undocumentation
  57.        (PC Magazine Vol 5 No 3 Feb 11, 1986 User-to-User)
  58.  
  59.      A hard disk's tree-structured directory system is helpful, but it
  60. can be very discouraging to get deep into a directory that has many
  61. subdirectories and then try to back out to the previous one.  If you
  62. are logged into a subdirectory called \D1\D2\D3\D4\D5 and you want to
  63. get to \D1\D2\D3\D4, you could type:  CD \D1\D2\D3\D4.  But there is
  64. an undocumented trick that will step back one subdirectory at a time
  65. -- just type:  CD..
  66.      Editor's Note:  The DOS manual says that you can see what files
  67. are in the parent directory by typing DIR.. but doesn't mention the
  68. use of the double dot in moving upward through subdirectories.  IBM
  69. pictures its tree-structured directories upside-down, with the roots
  70. at the top and the branches spreading down.  When IBM uses the term
  71. downward, it means away from the root; upward means toward the root.
  72. To move downward, type CD and the name of the next lower subdirectory
  73. -- without a backslash.  To move upward, type:  CD..  (This works only
  74. until you reach the level directory below the root directory -- try it
  75. in the root and all you'll get is an "Invalid directory" message.)  So
  76. if you're logged into \D1\D2\D3 and want to move to \D1\D2\D3\D4, just
  77. type:  CD D4.  You couldn't get to the same place with:  CD \D4  since
  78. DOS would think you wanted to get to a directory called \D4 that was
  79. just one level down from the root.  The reason for the confusion is
  80. that in the above case you're really not trying to get to a subdirectory
  81. called \D4; the full name of the desired subdirectory is \D1\D2\D3\D4.
  82. You need the full path before every subdirectory.  But to get from
  83. \D1\D2\D3 to \D1\D2\D3\D4 all you type is:  CD D4.
  84.  
  85. -----------------------------------------------------------------
  86.                     Command Line Redirection
  87.          (PC Tech Journal January 1986 by Stan Mitchell)
  88.  
  89.      To see how COMMAND.COM handles command line redirection, a simple
  90. program called BRK.EXE can be executed using IBM's Professional Debug
  91. Facility (RDT).  The assembly language for BRK.EXE is:
  92.  
  93.   PUSH DS, ;place INT 20H
  94. XOR AX,AX  ;address on stack for return
  95. PUH AX     ;                              NOTE:  This is not a typo.
  96. INT 3      ;enter RDT                            Could it be PUSH AX ?
  97. RET        ;terminate program
  98.  
  99. After the break, the window facility of RDT displays the Program
  100. Segment Prefix (PSP) and DOS's list of open file handles.
  101.      Each file handle returned by the DOS open function (3DH) is a
  102. 16-bit word in the range 0000H to 0013H.  DOS allows each process a
  103. maximum of 20 active file handles at one time.  Five of them have
  104. default assignments:
  105.  
  106. standard input device = 0000
  107. standard output device = 0001
  108. standard error device = 0002
  109. standard aux device = 0003
  110. standard prn device = 0004
  111.  
  112. For an IBM PC, these file handles initially map into the physical
  113. devices, CON, AUX, and PRN; the CON device uses handles 0000 to 0002.
  114. A single device or file can be mapped into multiple file handles using
  115. the DUP function 45H.
  116.      DOS keeps an internal sequential list of devices and files opened
  117. using function 3DH.  The list is a series of data structures, one for
  118. each file or device.  DOS allocates space for eight entries by default,
  119. but this can be changed by the FILES= command in CONFIG.SYS.  For
  120. files, an entry is made up of directory information; for devices, the
  121. entry contains the device header pointer and attribute information.
  122. Because one entry in this list may map into several file handles, an
  123. additional data structure is needed to define the mapping.  This
  124. structure is an array at offset 18H in the PSP.  The value of the
  125. element in the array is the file handle, and the sequence of the
  126. elements is the order that DOS opened the files or devices.  File
  127. handle numbering starts at 0; a value of FFH indicates an unused file
  128. handle.
  129.      If BRK.EXE is executed using the command "BRK", the file handle
  130. in the PSP will look like the following when the break occurs:
  131.  
  132. 01 01 01 00 02 FF FF FF FF .....FF
  133.  
  134. and the list of open devices and files will be AUX, CON, PRN.  This
  135. shows that AUX, the first device that was opened by DOS, has been
  136. assigned file handle 0003.
  137.      If BRK.EXE is executed with redirection using the command
  138. "BRK < CC.BAT >> TEXT", DOS opens the files CC.BAT and TEST and
  139. assigns to them file handles 0005 and 0006, so that the PSP looks like:
  140.  
  141. 01 01 01 00 02 03 04 FF FF FF FF .....FF
  142.  
  143. The input file (CC.BAT) handle is 0005 and the output file (TEST)
  144. handle is 0006 with corresponding list entries 03 and 04.  The, the
  145. redirection is done by mapping file handles 0000 and 0001 into entries
  146. 03 and 04, freeing up file handles 0005 and 0006.  Thus, the
  147. corresponding elements are set to FFH, and the PSP becomes:
  148.  
  149. 03 04 01 00 02 FF FF FF FF .....FF
  150.  
  151. which corresponds to the following open devices and files:  AUX, CON,
  152. PRN, CC.BAT, TEST.  This is the form of the PSP at the break point.
  153.      Standard input is obtained from the file CC.BAT, and the standard
  154. output is sent to the file TEXT, by mapping file handles 0000 and 0001
  155. to the corresponding files.
  156.      The redirection to TEST is an append operation, so COMMAND.COM
  157. not only opens TEST, but it also performs a file seek to the end of
  158. the file.  This is accomplished using DOS function 42H with subfunction
  159. 02H and CX=DX=0.  The IOCTL function allows the user to switch devices
  160. between raw, or binary, mode an ASCII mode so that ^Z is either passed
  161. or filtered when a device is read.  A similar toggle is not available
  162. for files, so that the file seek treats the file as binary without
  163. any detection of ^Z.  Thus, for a WordStar file, which pads the last
  164. 128-byte block of the file with ^Zs, any number of end-of-file marks
  165. may precede the append point.  For that matter, if a single ^Z is the
  166. last character of the file, the appended data will start at the next
  167. byte.
  168.      File pointer seeks cannot be done in binary and ASCII modes.  A
  169. method of looking through a file in ASCII that searches for ^Zs would
  170. need to look for the first end-of-file mark of the last byte file,
  171. whichever comes first.  The routine that does the file seek is in the
  172. transient portion of COMMAND.COM.  Patching it to high memory after it
  173. is relocated requires changing the transient checksum routine in the
  174. resident portion of COMMAND.COM, which is not desirable.
  175.      An alternative is to use the ASCII mode feature of the CON device
  176. by doing a redirected type with the batch file:
  177.  
  178. type %1 . temp
  179. del %1
  180. ren temp %1
  181.  
  182. Eliminating the ^Zs from file would allow the append operation to work
  183. as intended.
  184.  
  185. -----------------------------------------------------------------
  186.                      Hard Disk Park 'N Lock
  187.         (PC Magazine Vol 5 No 6 Mar 25, 1986 Power User)
  188.  
  189.      Hard disk heads should be parked before moving the machine from
  190. one desk to another or across the country.  Some manufacturers supply
  191. programs to do this, or you can use DEBUG to create PARK.COM that
  192. moves your hard disk's heads to the last (inmost) cylinder, which is
  193. reserved by the IBM BIOS for parking and testing.
  194.      PARK.COM uses a Hard Disk BIOS call to determine the size of the
  195. drive.  It then adds one to the cylinder to get the number of the
  196. reserved cylinder.  Having determined where to park the head, it then
  197. issues a different BIOS call to move the head to the parking cylinder.
  198. The process is repeated for a second drive; if either drive is not
  199. present, the BIOS calls have no effect.  To make sure that the heads
  200. don't accidentally get unparked, the last instruction in the program
  201. is a jump to itself.  This locks up the computer, requiring it to be
  202. turned off or reset via Ctrl-Alt-Del.  The program is only 48 bytes
  203. and will work on the IBM PC, XT and AT computers as well as most
  204. compatibles.
  205.  
  206. A>DEBUG
  207. -A
  208. xxxx:0100  MOV  AX,800
  209.            MOV  DX,80
  210.            INT  13
  211.            MOV  DX,80
  212.            XCHG CH,CL
  213. xxxx:010D  INC  CX
  214.            XCHG CH,CL
  215.            MOV  AX,C01
  216.            INT  13
  217.            MOV  AX,800
  218. xxxx:0118  MOV  DX,81
  219.            INT  13
  220.            MOV  DX,81
  221.            XCHG CH,CL
  222.            INC  CX
  223. xxxx:0123  XCHG CH,CL
  224.            MOV  AX,C01
  225.            INT  13
  226.            JMP  12A
  227. xxxx:012C
  228. -RCX
  229. CX 0000
  230. :30
  231. -NA:PARK
  232. -2
  233. Writing 0030 bytes
  234. -Q
  235.  
  236. A>RENAME PARK PARK.COM
  237.  
  238. -----------------------------------------------------------------
  239.                        Hard Disk Elbowroom
  240.                (PC World April 1986 Star-Dot-Star)
  241.  
  242.      If you're a PC XT user who works with DOS 3.1, you may have more
  243. room to rattle around your hard disk than you thought.  While it's
  244. impossible to physically enlarge a hard disk, you can reduce the
  245. average file size by at least 1024 bytes.  If, for example, your disk
  246. contains 500 files, you can gain access to as much as half a megabyte
  247. of otherwise unused space.
  248.      This recovery trick is possible because of the way DOS allocates
  249. disk space.  Space on a disk consists of many sectors, each 512 bytes
  250. in size.  DOS apportions that space in clusters.  A cluster is made up
  251. of one or more sectors; DOS sets the number of sectors per cluster
  252. when the disk is formatted.  In DOS version 2.x the cluster size for
  253. a 10MB disk is eight sectors (4096 bytes).  Thus, a file containing
  254. only one character will occupy 4096 bytes of disk space, and a file
  255. 4097 characters long will occupy two clusters -- 8192 bytes.
  256.      DOS 3.0 and later reduce the number of sectors per cluster to
  257. four -- provided you have a 20MB disk.  The cluster size for a 10MB
  258. disk remains set at 4096 bytes.
  259.      Reducing the cluster size from 4096 to 2048 bytes will trim 2048
  260. bytes off all files whose last cluster is less than half full.  On the
  261. average, half your files probably have a half-full (or less) last
  262. cluster.  If your disk is littered with short files (that is, less
  263. than 2048 bytes), the savings is even greater.
  264.      In this procedure to change the cluster size of your hard disk,
  265. you must use DOS 3.1, not 3.0.  First, display a directory of your
  266. hard disk and note the amount of available space.  Because adjusting
  267. the cluster size involves erasing all the files on your hard disk,
  268. back up the entire disk.  When you've finished the backup, put an
  269. exact copy (unmodified) DOS 3.1 disk in and restart the computer.  Run
  270. the FDISK program to create a DOS partition on the hard disk, then
  271. format the hard disk using the FORMAT command.  Do not use the /V or
  272. /S options.
  273.      When formatting is complete, place a copy of the DOS Supplemental
  274. Programs disk in and enter the commands listed in DISKSIZE below.
  275. Substitute the appropriate hard disk drive number for n -- drive B:
  276. is 1, drive C: is 2, drive D: is 3, and so on.
  277.      Next, insert the DOS 3.1 disk and reboot the computer.  Format
  278. the hard disk again, but this time specify the /S option to transfer
  279. DOS to that disk.  You may also use the /V option to assign a volume
  280. label.  Finally, reload your files onto the hard disk from the backup
  281. you made.  Do not reload files IBMBIO.COM and IBMDOS.COM because
  282. they'll be placed in the wrong location, forcing you to reformat the
  283. hard disk and start over.  If your backup contains a version of
  284. COMMAND.COM other than DOS 3.1, do not reload it either.  If you are
  285. relying on the RESTORE command, you can use the /P option, which
  286. prompts you before any system files are reloaded.
  287.      Now remove the last backup disk and restart the computer from the
  288. hard disk.  You should see a significant increase in available space.
  289.      Editor's Note:  This procedure applies only to 10MB disks; DOS 3.1
  290. automatically formats 20MB disks with 2048-byte clusters.  If your hard
  291. disk contains any copy-protected software, be sure to "uninstall" it
  292. before you begin this process.  DOS 3.1 was expressly designed to use
  293. the larger cluster size on 10MB disks.  Without probing the reason for
  294. that design decision, you should consider that implementing a smaller
  295. cluster size might conflict with some existing or future products.
  296.  
  297. DISKSIZE:
  298.  
  299. A>DEBUG
  300. -L 0 n 0 1
  301. -E 0D
  302. xxxx:000D 08.04
  303. -E 16
  304. xxxx:0016 08.15
  305. -W 0 n 0 1
  306. -Q
  307.  
  308. -----------------------------------------------------------------
  309.                          Volume Please?
  310.        (PC Magazine Vol 5 No 8 Apr 29, 1986 User-to-User)
  311.  
  312.      Although it's not documented, it's possible to change the volume
  313. label of a disk under DOS 2.1.  The trick uses DEBUG to load the
  314. directory, changes the volume label, and writes the directory back.
  315. First, load DEBUG.  Once you see the hyphen prompt, type:
  316.  
  317. L 100 0 5 1
  318.  
  319. Then hit D to dump the contents, showing the label at &h160.  Type the
  320. following line, where "labelname" is the new name you want (be sure to
  321. make this new name exactly 11 characters; if it's shorter, add spaces
  322. at the end to pad it out):
  323.  
  324. E 160 "labelname  "
  325.  
  326. Then, to write the revised directory back to disk, type:
  327.  
  328. W 100 0 5 1
  329.  
  330.  
  331. Finally, hit Q to exit DEBUG.  Using this method will also allow
  332. otherwise illegal characters such as a period or small letters.
  333.  
  334. Editor's Note:  Sort of.  The instructions above are only for a floppy
  335. disk in drive A: that has just three files on it (presumably the two
  336. system files IBMBIO.COM and IBMDOS.COM, and COMMAND.COM) plus the
  337. volume label.  A gutted version of the DEBUG dump of such a disk's
  338. directory would look something like this:
  339.  
  340. xxxx:0100  IBMBIO  COM'....
  341. xxxx:0110  ......`mg...\%..
  342. xxxx:0120  IBMDOS  COM'....
  343. xxxx:0130  ......4a....pl..
  344. xxxx:0140  COMMAND COM ....
  345. xxxx:0150  ......'mg.(..Z..
  346. xxxx:0160  LABELNAME  (....
  347. xxxx:0170  ................
  348.  
  349.      However, to your system, a volume label is simply one directory
  350. entry identified in a special way.  DOS uses the 12th byte of the
  351. directory listing (actually byte 11, since the first byte is byte 0)
  352. to mark the file attribute(s).  This byte will tell DOS whether a file
  353. is a hidden file, a system file, a read-only file, etc.  It also
  354. identifies directory entries that are subdirectory names (by giving
  355. this byte a value of 10) of volume labels (by giving it a value of 8).
  356. And it lets DOS know whether the file was changed since the previous
  357. backup.
  358.      The value of the attribute byte for LABELNAME in the above example
  359. is 28, which means that it is a volume label and that the archive bit
  360. is set.  However, LABELNAME doesn't have to be the fourth entry in the
  361. directory.  It will be the fourth entry if you format a fresh disk
  362. using the /S option (or if you format it without /S but then immediately
  363. use SYS to transfer the system files), and then immediately add a volume
  364. label.  But the volume label could be anywhere on the directory.
  365.      If it is the fourth entry, you will indeed find it at address
  366. &h160.  But if you don't have system files on your disk, the label
  367. could be at a lower address.  And if you add the label after creating
  368. several files, the label could be at a higher address.  To find it,
  369. after using the DEBUG L command to load the directory, use the D
  370. command to examine the twelfth bytes -- and look for a value of 8 or
  371. 28.  But be very careful.  Note the DEBUG refers to drive A: as drive
  372. 0, drive B: as drive 1, etc.  So "L 100 0 5 6" would mean "load six
  373. sectors of drive A: starting with sector 5 -- all into memory starting
  374. at address 100".  The W command uses the same format.  It's simple to
  375. type in an errant value and write a scrambled directory back to your
  376. disk.  So if you try this, do it on a copy of a floppy disk only.  And
  377. to be perfectly safe, don't ever write to a hard disk unless you're
  378. really sure of yourself and have a perfect backup copy handy.
  379.      Recent versions of DOS supply you with a LABEL utility to do
  380. what you want.  And while this method does allow you to put illegal
  381. characters in the volume name, DOS will probably be confused by it.
  382.  
  383.  
  384.  
  385.  
  386.                        Upgrading Your DOS
  387.         (PC Magazine Vol 5 No 11 June 10, 1986 PC Tutor)
  388.  
  389.      Generally it's a good idea to keep pace with the most current DOS
  390. releases.  For the most part, DOS versions are upwardly compatible --
  391. programs written for an earlier DOS version almost always run under
  392. later DOS versions.  (The exceptions, which were significant back in
  393. the days when DOS 2.0 came out, often resulted from clumsy copy-
  394. protection schemes or dumb programming practices.)
  395.      Ostensibly, DOS upgrades have been released to support hardware
  396. changes and additional members to the PC family:
  397.  
  398.           DOS 1.1:  Double-sided diskettes
  399.               2.0:  PC-XT and hard disk
  400.               2.1:  PCjr
  401.               3.0:  PC AT
  402.               3.1:  IBM Network
  403.               3.2:
  404.  
  405.      Version 2.0 represented a major step over 1.1 since it introduced
  406. support of subdirectory disk organization.  Version 2.1 fixed some bugs
  407. in 2.0 besides supporting the PCjr.  Version 3.0 was not as great an
  408. advance as 2.0 was, but it added a few commands such as ATTRIB (which
  409. can mark files as Read-Only to protect them from changes) and LABEL,
  410. which changes the volume label on a disk.  DOS 3.0 also included a
  411. RAMdisk program called VDISK.  DOS 3.1 fixes some of the buggy parts
  412. of 3.0.  The new commands in DOS 3.1 are SUBST, which can define a new
  413. drive letter to refer to a subdirectory, and JOIN, which can make one
  414. disk drive appear as a subdirectory of another disk drive.
  415.      The DOS 3.1 SUBST command proved to be a real blessing to WordStar
  416. users, for it allowed us to refer to directories by new disk letters.
  417. While WordStar knows nothing about subdirectories, it can easily
  418. recognize new disk letters and so works fine with SUBST.
  419.      The change in the TREE command that lets it list files in the
  420. root directory is another illustration of something that hadn't worked
  421. right since DOS 2.0 and was finally fixed in DOS 3.1.
  422.      Upgrading a hard disk to a new DOS version is no big deal.  If
  423. you're concerned that some of your existing programs may not run under
  424. DOS 3.1, you can experiment with DOS 3.1 before installing it on your
  425. hard disk.  To do this, intead of booting from the hard disk (as you
  426. probably do now), just put a copy of the DOS 3.1 system disk (including
  427. your CONFIG.SYS and AUTOEXEC.BAT files) in drive A: and boot from that.
  428. Try using your PC with the new DOS for a few days or weeks until you
  429. satisfy yourself that all is well.  (If you have a PATH that points to
  430. a directory where the DOS programs are located, you should change that
  431. part of the PATH to point to drive A:.)  Until you have completed your
  432. changeover, a few DOS 2.0 programs (such as CHKDSK and TREE) will give
  433. you an "Incorrect DOS Version" message under DOS 3.1.  (Most (like
  434. EDLIN and DEBUG) will run fine.
  435.      When you've satisfied yourself that everything works under the new
  436. DOS version, installing the new DOS on the hard disk is a fairly simple
  437. process.  You do not need to use FDISK or FORMAT again.  Instead, use
  438. the SYS command, which transfers DOS to a disk that has already been
  439. formatted with room for the operating system.  After you've booted from
  440. drive A: with the new DOS version and ensured that your current drive
  441. is A:, enter the following three commands:
  442.  
  443. SYS C:
  444. COPY COMMAND.COM C:\
  445. COPY *.* C:\DOS
  446.  
  447. The last line assumes you keep the programs included with DOS in a
  448. directory called DOS.  You could alternatively just copy them to C:\
  449. if you keep them in the root directory.  Or you could create a
  450. directory called DOS for this purpose:
  451.  
  452. MD C:\DOS
  453.  
  454. After you're done, you'll be able to boot the new DOS version from
  455. the hard disk.
  456.  
  457. -----------------------------------------------------------------
  458.                         Dumping Graphics
  459.         (PC Magazine Vol 5 No 11 June 10, 1986 PC Tutor)
  460.  
  461.      The Print Screen routine coded in the ROM BIOS works only with
  462. characters.  If the display is in a graphics mode, it will only print
  463. characters that it can recognize but will not translate the graphics.
  464. This is a reasonable restriction, since graphics protocols for
  465. printers vary widely and the ROM BIOS surely cannot be expected to
  466. support them all.
  467.      GRAPHICS.COM supplements the ROM BIOS Print Screen routines.
  468. GRAPHICS.COM remains resident in memory, so you only need load it once
  469. during your PC session.  It prints 320 x 200 four-color graphics (video
  470. modes 4 and 5), and 640 x 200 black-and-white graphics (video mode 6)
  471. to an IBM Graphics Printer or compatible.  GRAPHICS.COM uses different
  472. dot densities for the four colors of the 320 x 200 mode to simulate
  473. color.  DOS 3.0 and 3.1 versions of GRAPHICS also support the IBM Color
  474. Printer (with black, RBG, or CMY ribbons) and the IBM Compact Printer.
  475.      One would expect GRAPHICS.COM to support the additional video
  476. modes of the IBM Enhanced Graphics Adapter, but it does not.  Since
  477. IBM didn't bother to add the PCjr video modes to GRAPHICS when the
  478. machine was being manufactured, don't look for future support.
  479.      Graphics screen dump programs are generally considered printer
  480. utilities rather than screen utilities.
  481.  
  482. -----------------------------------------------------------------
  483.                  Backing Up Selected Directories
  484.               (PC World The Help Screen June 1986)
  485.  
  486.      To each file that BACKUP saves, it adds a header that contains
  487. the full path to the directory from which the file is being copied.
  488. Should it become necessary to replace a hard disk file with its
  489. backup, or to recreate your entire directory structure on a newly
  490. formatted hard disk, RESTORE will read each backup file's header to
  491. determine the directory into which the file should be copied.  If the
  492. directory does not exist, BACKUP will create it.
  493.      There's no need to worry about maintaining your hard disk's
  494. directory structure on the backup floppies -- BACKUP and RESTORE do
  495. it for you.  Just type:  BACKUP C:\*.* A: /S <Enter>  to back up your
  496. files.  C:\ tells BACKUP to save all the files in the root directory
  497. of drive C:; the A: indicates the target drive, and teh /S indicates
  498. that all files in the subdirectories under the specified directory,
  499. C:\, are to be backed up.
  500.      Although BACKUP does not violate DOS syntax, it has its own
  501. syntactical restrictions.  BACKUP's first parameter lets you choose
  502. a specific directory and/or file (or group of files, using the global
  503. file name characters ? and *) from the drive to be backed up; the
  504. command's second parameter simply notes the drive destined to contain
  505. the backup files.  Because BACKUP keeps track of the directory of each
  506. backup file, backing up files into a particular directory on the
  507. target disk is unnecessary.
  508.  
  509. -----------------------------------------------------------------
  510.                     Overlays From a Hard Disk
  511.               (PC World The Help Screen June 1986)
  512.  
  513.      A menu system can be used with a hard disk such that applications
  514. can be selected and run by pressing one key (PC World Volume 2 Number
  515. 11).  Although the menu system works, some applications that use
  516. overlay files require that the program's disk be placed in drive A:
  517. even though the overlay files reside on the hard disk.
  518.      DOS can be instructed to look to drive C: when an application
  519. requests an overlay file from drive A:.  You should note, however,
  520. that you must temporarily relinquish use of drive A: while running
  521. that application.  Find the command in the menu system's batch file
  522. that calls the application.  Insert the command "ASSIGN A=C" before
  523. the application call and the command "ASSIGN" after the application
  524. call.  Be certain that the DOS command ASSIGN resides in the same
  525. directory as the application, or in a directory listed in the last
  526. PATH command, and your menu system is ready for action.
  527.  
  528. -----------------------------------------------------------------
  529.                      Hard Disk Organization
  530.         (PC Magazine Vol 5 No 12 June 24, 1986 PC Tutor)
  531.  
  532.      Hard disk organization is important for a variety of reasons.
  533. It's generally a good practice to put each large application program
  534. and install on your hard disk in its own directory.  The hard disk
  535. installation programs usually assume that you're doing this.  Many
  536. will not work unless all the files the program needs are in the same
  537. directory.
  538.      It's often easiest to keep the data files you create with the
  539. application program in the same subdirectory as the application program
  540. itself.  If you start getting too many data files, separate them into
  541. categories and split off some subdirectories from the application
  542. directory.
  543.      For starters, then, depending upon the applications you use, you
  544. might create the following directories on your hard disk:
  545.  
  546. DOS    - All PC-DOS programs
  547. UTIL   - Small utility programs
  548. BATCH  - Batch files
  549. LOTUS  - Lotus 1-2-3 and worksheets
  550. DBASE  - dBASE II or III and databases
  551. WS     - WordStar and text files
  552. BASIC  - Compiler and programs
  553.  
  554.      The DOS directory contains all the programs included on the two
  555. DOS disks.  Keeping all these files isolated in one directory will help
  556. if you upgrade to a higher DOS version in the future.  UTIL might
  557. contain small utility programs.  Batch files go in the BATCH directory,
  558. and the other four directories would contain all the files associated
  559. with those well-known packages.
  560.      The only files you really need in the root directory (besides the
  561. two hidden PC-DOS files) are COMMAND.COM, AUTOEXEC.BAT, and CONFIG.SYS.
  562. You can create the CONFIG.SYS and AUTOEXEC.BAT files with EDLIN or any
  563. text editor that creates an unformatted ASCII file.  At a minimum, your
  564. hard disk CONFIG.SYS should contain:
  565.  
  566. FILES=20
  567. BUFFERS=20
  568.  
  569. If you've been using a hard disk without a BUFFERS statement in a
  570. CONFIG.SYS file, you are ging to be amazed at the difference in disk
  571. access time that simple statement makes.
  572.      You may also have some DEVICE= lines in the CONFIG.SYS if you
  573. have a mouse, use a RAMdisk, have an expanded memory board, or use
  574. ANSI.SYS.  Although CONFIG.SYS must be in the root directory of your
  575. hard disk, these device files themselves don't have to be.  For
  576. instance, to install a 128K RAMdisk under DOS 3.0 or 3.1, use the line:
  577.  
  578. DEVICE=C:\DOS\VDISK 128
  579.  
  580. in your CONFIG.SYS.  The VDISK program would be located in your DOS
  581. directory.
  582.      The AUTOEXEC.BAT file should contain at least a PATH command that
  583. will look something like:
  584.  
  585. PATH=C:\BATCH;C:\UTIL;C:\DOS
  586.  
  587. The PATH command is one of the most important ingredients of effective
  588. hard disk organization.  If you want to run a program not in your
  589. current subdirectory, DOS will search for it in any directories listed
  590. in your PATH command.
  591.      Another statement you'll probably want in the AUTOEXEC.BAT is:
  592.  
  593. PROMPT $p$g
  594.  
  595. This displays the current directory as part of the DOS prompt.
  596.      Another important tool for navigating around the hard disk is a
  597. collection of small batch files that you could keep in the BATCH
  598. directory.  Although the PATH command is fine for simple one-file
  599. programs, many application programs load additional driver files,
  600. overlay files, and what-not when you execute them.  They generally
  601. require that these files be in a current directory; the PATH command
  602. alone wouldn't suffice.
  603.      These small batch files can help where the PATH command cannot.
  604. For instance, if you use 1-2-3, you can create a batch file in your
  605. BATCH subdirectory called L.BAT.  This file would contain the lines:
  606.  
  607. CHDIR \LOTUS
  608. LOTUS
  609.  
  610. Then, to run 1-2-3 from any directory, all you need to type is L.
  611.      Hard disk organization may be somewhat different if more than one
  612. person uses the PC.  If everybody who uses the PC works with different
  613. applications, then you could start off with directories of the people's
  614. names, and each of these directories would have subdirectories with the
  615. applications they use.
  616.      Creating hard disk directories dedicated to various multiapplica-
  617. tion jobs (for instance, family finances) also makes sense.  But
  618. because you could be using different applications with the same job,
  619. you'll have to make sure the applications can get at these different
  620. directories.  The need to create such directories will become apparent
  621. if you find that files connected with specific jobs are scattered all
  622. over the hard disk.
  623.  
  624. -----------------------------------------------------------------
  625.                     Burning in a Screen Image
  626.          (PC Magazine Vol 5 No 2 June 24, 1986 PC Tutor)
  627.  
  628.      Phosphor burn is when you see a spreadsheet on the display even
  629. though the machine is off.  The best way to prevent phosphor burn on
  630. the monochrome display is to use the bottom knob on the front of the
  631. monitor.  Leaving the knob turned to the right causes the problem,
  632. particularly if a single unchanging image is left on the screen.
  633. Turning the knob counter-clockwise during periods when you're not
  634. using the machine prevents the problem from occurring.  Proper use of
  635. this brightness knob should allow the monochrome display to last for
  636. years.  Leaving the display sitting for hours with a blindingly bright
  637. spreadsheet on it could cause burns with a few days.
  638.      Several public-domain utilities are available that shut off a
  639. monochrome display attached to the IBM Monochrome Adapter after a
  640. certain period has elapsed when nothing has been typed on the keyboard.
  641. Pressing any key turns the display back on.  These utilities will not
  642. work on the Enhanced Graphics Adapter.  Technically, screen-blanking
  643. utilities for the Monochrome Adapter can shut off the display by
  644. writing a 0 to bit 3 of output port 3B8h.  This bit disables the video
  645. signal.  Port 3B8h does not exist on the EGA.  Although these screen-
  646. blanking utilities have no effect on the EGA, some of them have a very
  647. serious effect when used with a Hercules Monochrome Graphics Adapter.
  648.      Like everything with the EGA, disabling the video signal is more
  649. complex than with the Monochrome or Color Graphics Adapters.  If you
  650. do accidently do leave the display at high intensity and cause some
  651. phosphor burns on your monochrome monitor, that will give you an excuse
  652. to buy an Enhanced Color Display, which is the perfect companion for
  653. the EGA.
  654.  
  655. -----------------------------------------------------------------
  656.                     Strange Files When Piping
  657.         (PC Magazine Vol 5 No 12 June 24, 1986 PC Tutor)
  658.  
  659.      After upgrading to DOS 3.1 and entering the command: TREE/F | MORE
  660. an unusual display occurred.  The root directory file listing, which is
  661. displayed for the first time under DOS 3.1, shows up normally when the
  662. MORE filter is not used, but it contains two 8-digit hex numbers when
  663. MORE is used.  Repeating the command produces different hex numbers.
  664.      The answer is that DOS filter programs work by directing output
  665. from one program, in this case TREE, to become input for another
  666. program, in this case MORE.  COMMAND.COM manages the piping by saving
  667. the output from TREE in a temporary disk file and then retrieving this
  668. file for input to MORE.  The 8-digit hex strings you get are actually
  669. filenames created during this process.  DOS 3.x uses the PC's clock to
  670. derive names for the temporary files.  That's why they look like
  671. numbers.  (DOS 2.x uses temporary filenames with the word PIPE in them,
  672. which at least gives a hint of what they are.)  If you pipe DIR through
  673. MORE on the root directory, you'll see these two files listed as having
  674. 0 bytes because they've been created but not yet closed.  After MORE
  675. runs, COMMAND.COM deletes the files.  If you undelete the files,
  676. you'll find that one of the files has all the piped data in it.  Since
  677. only one file is needed, the question then becomes, what does the
  678. second file contain?  The answer is nothing.  In this case, solving
  679. one mystery reveals another.
  680.  
  681.